package com.simple.study.controller.role;

import com.simple.study.base.controller.BaseController;
import com.simple.study.entity.ShopResult;
import com.simple.study.pojo.Role;
import com.simple.study.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName RoleController
 * @Author SimpleTree
 **/
@RestController
@RequestMapping("/roles")
public class RoleController extends BaseController {
    @Autowired
    private RoleService roleService;

    @GetMapping
    public ShopResult getRoles() {
        List<Role> roles = roleService.getRoles();
        return shopSuccess(200,"成功",roles);
    }

}
